/*
** P46
*/

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main () {
    int N, i = 2, expon = 0, isPrime = 1;
    scanf("%d",&N);
    if ( N < 1 ) {
        printf("err\n");
        return EXIT_FAILURE;
    } else if ( N == 1 ) {
        printf("1=1");
        return EXIT_SUCCESS;
    } else {
        printf("%d=",N);
        for ( i = 2; i <= N; i++ ) {
            while ( N % i == 0 ) {
                isPrime = 0;
                N/=i;
                expon++;
            }
            if ( expon > 1 ) {
                printf("%d^%d",i,expon);
                expon = 0;\
                break;
            } else if ( expon == 1 ) {
                printf("%d",i);
                expon = 0;
                break;
            }
        }
        for ( ; i <= N; i++ ) {
            while ( N % i == 0 ) {
                N/=i;
                expon++;
            }
            if ( expon > 1 ) {
                printf("*%d^%d",i,expon);
                expon = 0;
            } else if ( expon == 1 ) {
                printf("*%d",i);
                expon = 0;
            }
        }
        if ( isPrime ) {
            printf("%d=%d",N,N);
        } 
    }
    return 0;
}